package com.gitee.myclouds.examples.discovery.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 演示基于RestTemplate消费服务
 * @author xiongchun
 *
 */
@RestController
public class RestTemplateConsumerController {

	@Autowired
	private RestTemplate restTemplate;

	private static final String SERVICE_NAME = "http://myclouds-nacos-discovery-provider-example";

	@GetMapping("findCardInfo")
	public String test1(String cardNo) {
		return restTemplate.getForObject(SERVICE_NAME + "backCard/findCardInfo", String.class);
	}

}
